//---------------------------------------------------------------------------

#ifndef FMainWndH
#define FMainWndH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Buttons.hpp>
#include <ComCtrls.hpp>
#include <IdBaseComponent.hpp>
#include <IdComponent.hpp>
#include <IdTCPServer.hpp>
#include <IdUDPBase.hpp>
#include <IdUDPServer.hpp>
#include <ExtCtrls.hpp>
#include <Menus.hpp>
#include <AppEvnts.hpp>
#include <IdIntercept.hpp>
#include <IdLogBase.hpp>
#include <IdLogDebug.hpp>
#include <ImgList.hpp>
#include <IdHTTPServer.hpp>
#include "IdContext.hpp"
#include "IdCustomHTTPServer.hpp"
#include "IdCustomTCPServer.hpp"
//---------------------------------------------------------------------------



class TMainWnd : public TForm
{
__published:	// IDE-managed Components
   TMemo *MLogMsg;
   TStatusBar *StatusBar;
   TGroupBox *GroupBox1;
   TBitBtn *BB_Start;
   TBitBtn *BB_Stop;
   TGroupBox *GroupBox2;
   TCheckBox *CB_Tray;
   TTimer *Timer1;
   TIdTCPServer *IdTCPServer;
   TGroupBox *GroupBox4;
   TMemo *LogClient;
   TPopupMenu *PopupMenuTray;
   TMenuItem *N1;
   TMenuItem *N2;
   TMenuItem *MN_Started;
   TMenuItem *MN_Stopped;
   TGroupBox *GroupBox5;
   TCheckBox *CB_AutoStartServer;
   TBevel *Bevel1;
   TApplicationEvents *ApplicationEvents1;
   TImageList *ImageListIcons;
   TIdHTTPServer *IdHTTPServer;
   TPageControl *PC_ConfigStore;
   TTabSheet *TabSheet1;
   TTabSheet *TabSheet2;
   TTabSheet *TabSheet3;
   TListBox *LB_ListModules;
   TTabSheet *TabSheet4;
   TPanel *PanelNameModule;
   TPanel *Panel2;
   TLabel *Label4;
   TLabel *Label3;
   TComboBox *CB_Port1;
   TComboBox *CB_Port2;
   TCheckBox *CB_Com2_Enable;
   TCheckBox *CB_Com1_Enable;
   TPanel *Panel3;
   TPanel *Panel4;
   TPanel *Panel5;
   TGroupBox *GroupBox6;
   TComboBox *CB_CamAddr;
   TEdit *E_DevCam;
   TGroupBox *GroupBox3;
   TLabel *Label5;
   TLabel *Label6;
   TEdit *E_HttpSrvPort;
   TEdit *E_HttpSrvIP;
   TCheckBox *CB_HttpSrvEnabled;
   TGroupBox *GroupBox7;
   TLabel *Label7;
   TLabel *Label8;
   TEdit *E_TcpIP;
   TEdit *E_TcpPort;
   TCheckBox *CB_TcpSrvEnabled;
   TBitBtn *BB_Apply;
   TCheckBox *CheckBox5;
   TEdit *E_mod_cfg_path;
   TLabel *Label1;
   TBitBtn *BB_SelDir;


   void __fastcall BB_StartClick(TObject *Sender);
   void __fastcall BB_StopClick(TObject *Sender);
   void __fastcall FormShow(TObject *Sender);
   void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
   void __fastcall BB_ApplyClick(TObject *Sender);
   void __fastcall E_TcpIPChange(TObject *Sender);
   void __fastcall E_TcpPortChange(TObject *Sender);
   void __fastcall CB_TrayClick(TObject *Sender);
   void __fastcall Timer1Timer(TObject *Sender);
   void __fastcall CB_AutoStartServerClick(TObject *Sender);
   void __fastcall CB_Port1Change(TObject *Sender);
   void __fastcall CB_Com1_EnableClick(TObject *Sender);
   void __fastcall CB_Com2_EnableClick(TObject *Sender);
   void __fastcall CB_Port2Change(TObject *Sender);
   void __fastcall E_DevCamChange(TObject *Sender);
   void __fastcall CB_CamAddrChange(TObject *Sender);
   void __fastcall N1Click(TObject *Sender);
   void __fastcall MN_StartedClick(TObject *Sender);
   void __fastcall MN_StoppedClick(TObject *Sender);
   void __fastcall LB_ListModulesClick(TObject *Sender);
   void __fastcall E_HttpSrvIPChange(TObject *Sender);
   void __fastcall E_HttpSrvPortChange(TObject *Sender);
   void __fastcall CB_HttpSrvEnabledClick(TObject *Sender);
   void __fastcall CB_TcpSrvEnabledClick(TObject *Sender);
   void __fastcall BB_SelDirClick(TObject *Sender);


private:	// User declarations

   AnsiString aszMainName;

   void UpdateWindowbySettings();
   void UpdateSettingsWnd(int item);
   bool OpenDialogDirectory(UnicodeString uszTitle, UnicodeString *uszPath);


   bool StartLan();
   bool StopLan();


   bool fInit;


public:		// User declarations
   __fastcall TMainWnd(TComponent* Owner);

};
//---------------------------------------------------------------------------

extern PACKAGE TMainWnd *MainWnd;
//---------------------------------------------------------------------------
#endif
